<?php

namespace app\common;
require_once __DIR__.'/Base.php';

require_once __DIR__.'/TableTool.php';
require_once __DIR__.'/Validate.php';
require_once __DIR__.'/Common.php';
require_once __DIR__.'/RpcClient.php';

use app\common\Base;
use app\common\TableTool;
use app\common\Validate;
use app\common\Common;
use RpcClient;

//基类控制器
class Controller extends Base
{
    

    protected $table = null; //数据库
    protected $validate = null; //验证
    protected $common = null;  //常用函数对象

    public function __construct()
    {

        parent::__construct();


        var_dump('Controller __construct');
        $this->table = new TableTool(); 
        $this->validate = new Validate();
        $this->common = new Common(); 

        $this->rpc_config();
    }

    public function rpc_instance($name='')
    {
        return RpcClient::instance($name);
    }

    public function rpc_config()
    {
        $address_array = array(
              'tcp://192.168.101.201:2015',
              'tcp://192.168.101.201:2015'
              );
        RpcClient::config($address_array);
    }

}





